// Copyright (c) 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

/**
*@describe:
*@author wfl19/Kristas
*@date 2021/12/18
 */

package select_mapper

import "gorm.io/gorm"

type SelectAllMapper struct {
	table string
	db    *gorm.DB
}

func NewSelectAllMapper(table string, db *gorm.DB) *SelectAllMapper {
	return &SelectAllMapper{table: table, db: db}
}

func (s *SelectAllMapper) SelectAll(value Any) error {
	return s.db.Table(s.table).Find(value).Error
}
